//
//  JNNewsModel.m
//  JNNetEestNews
//
//  Created by Jyougen on 2017/3/10.
//  Copyright © 2017年 Jyougen. All rights reserved.
//

#import "JNNewsModel.h"
#import "JNSessionManager.h"
#import <YYModel.h>

@implementation JNNewsModel

+ (void)getNewsArrWithUrlStr:(NSString *)urlStr WithArrBlock:(void(^)(NSArray * array))arrBlock{
    
    [[JNSessionManager sharedManager] reqestWithRequestType:RequestTypeGet andURLStr:urlStr andSuccessBlock:^(id response) {
        
        NSDictionary * dic = (NSDictionary *)response;
        
        NSString * key = dic.allKeys.firstObject;
        
        NSArray * arr = [dic objectForKey:key];
        
        NSArray * modelArr = [NSArray yy_modelArrayWithClass:[JNNewsModel class] json:arr];
        
        arrBlock (modelArr);
        
    } andFailureBlock:^(NSError *error) {
        
    }];
    

    
}

@end
